]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Fix windows not getting undimmed in some cases
authorRui Matos <tiagomatos@gmail.com>
Mon, 22 Aug 2016 14:56:41 +0000 (16:56 +0200)
committerRui Matos <tiagomatos@gmail.com>
Fri, 9 Sep 2016 15:17:06 +0000 (17:17 +0200)
meta_window_foreach_transient() iterates through all transients of a
window, not only direct transients. This means that simply checking if
a transient is an attached dialog isn't enough because it might be a
non-direct transient for the window we're checking, in which case we
don't want to dim the window.

In particular this fixes windows not getting undimmed when they have
more that one level of transient children and the direct transient gets
destroyed. In that case we would still find at least one non-direct
transient child and decide to keep the window dimmed.

https://bugzilla.gnome.org/show_bug.cgi?id=770163

js/ui/windowManager.js

index 51ce482c4155774fcc65b32c1d4db87549e130b5..5222b986d604f169398abe6cfdd11b667b2e2568 100644 (file)
@@ -1349,9 +1349,13 @@ const WindowManager = new Lang.Class({
     _hasAttachedDialogs: function(window, ignoreWindow) {
         var count = 0;
         window.foreach_transient(function(win) {
-            if (win != ignoreWindow && win.is_attached_dialog())
+            if (win != ignoreWindow &&
+                win.is_attached_dialog() &&
+                win.get_transient_for() == window) {
                 count++;
-            return false;
+                return false;
+            }
+            return true;
         });
         return count != 0;
     },